﻿' LibWowArmory
' by Ronald M. Clifford (roncli@roncli.com)
'
' This source code is released under the GNU Library General Public License (LGPL) Version 2.1.

Imports roncliProductions.LibWowArmory.Calendar.Detail

Namespace roncliProductions.LibWowArmory.Calendar.Month.User

    ''' <summary>
    ''' A class that defines an event
    ''' </summary>
    ''' <remarks></remarks>
    Public Class CalendarEvent
        Private cmuParent As CalendarMonthUser
        Private lngStart As Long

        ''' <summary>
        ''' Contains further detail about the calendar event
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property Detail As CalendarDetail
            Get
                Return New CalendarDetail(cmuParent.Username, cmuParent.Password, cmuParent.Realm, cmuParent.Name, EventID)
            End Get
        End Property

        ''' <summary>
        ''' The calendar type of the calendar event
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property CalendarType As String

        ''' <summary>
        ''' The icon of the calendar event
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Icon As String

        ''' <summary>
        ''' The identification number of the event
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property EventID As Integer

        ''' <summary>
        ''' Determines whether or not the character is a moderator for the event
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Moderator As Boolean

        ''' <summary>
        ''' The date of the event, in UTC
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property UTCStart As Date
            Get
                Return New Date(1970, 1, 1).AddMilliseconds(lngStart)
            End Get
        End Property

        ''' <summary>
        ''' The character's invitation status for the calendar event
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Status As String

        ''' <summary>
        ''' The summary of the calendar event
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Summary As String

        ''' <summary>
        ''' The type of calendar event
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property EventType As String

        ''' <summary>
        ''' The date of the event, in local server time
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property Start As Date
            Get
                Return New Date(1970, 1, 1).AddMilliseconds(lngStart).Add(cmuParent.TimezoneOffset)
            End Get
        End Property

        ''' <summary>
        ''' A constructor to create a new calendar event
        ''' </summary>
        ''' <param name="strCalendarType"></param>
        ''' <param name="strIcon"></param>
        ''' <param name="intID"></param>
        ''' <param name="blnModerator"></param>
        ''' <param name="lngStart"></param>
        ''' <param name="strStatus"></param>
        ''' <param name="strSummary"></param>
        ''' <param name="strEventType"></param>
        ''' <param name="cmuParent"></param>
        ''' <remarks></remarks>
        Public Sub New(ByVal strCalendarType As String, ByVal strIcon As String, ByVal intID As Integer, ByVal blnModerator As Boolean, ByVal lngStart As Long, ByVal strStatus As String, ByVal strSummary As String, ByVal strEventType As String, ByVal cmuParent As CalendarMonthUser)
            CalendarType = strCalendarType
            Icon = strIcon
            EventID = intID
            Moderator = blnModerator
            Me.lngStart = lngStart
            Status = strStatus
            Summary = strSummary
            EventType = strEventType
            Me.cmuParent = cmuParent
        End Sub

    End Class

End Namespace
